<!--
	作者：2575202388@qq.com
	时间：2019年8月6日17:11:53
	描述：家长推荐书籍管理
-->

<template>
	<div style="width:100%;">
		<div style="background: #fff;">
			<div style="width:100%;float:left;padding-top: 10px;padding-bottom: 10px;">
				
				<div style="text-align: right;float:left;line-height:32px;padding-left:10px;">书籍分类：</div>
				<div style="width:30%;float:left;">
					<Select v-model="tj.pid" style="width:45%;float:left;" clearable @on-change="getnextClass">
				        <Option v-for="item in pclass" :value="item.CLASSID" :key="item.CLASSNAME">{{ item.CLASSNAME }}</Option>
				    </Select>
				    <Select v-model="tj.classid" style="width:45%;float:left;" clearable>
				        <Option v-for="item in nclass" :value="item.CLASSID" :key="item.CLASSNAME">{{ item.CLASSNAME }}</Option>
				    </Select>
				</div>
				
				<div style="text-align: right;float:left;line-height:32px;padding-left:10px;">书籍名称：</div>
				<div style="width:12%;float:left;">
					<Input v-model="tj.bookname"  clearable  style="width: 90%;float:left;" />
				</div>
					
				<div style="text-align: right;float:left;line-height:32px;padding-left:10px;">作者：</div>
				<div style="width:12%;float:left;">
					<Input v-model="tj.author"  clearable  style="width: 90%;float:left;" />
				</div>
					
				<div style="width:30%;text-align: left;float:left;">
					<Button v-on:click="search()" style="margin-left:1%;background: #ffa500;color:#fff;border:1px solid #ffa500;">搜索</Button>
					<Button v-on:click="openxdth()" icon="ios-book" style="background-color: #B4CDCD;color:#fff;border:1px solid #B4CDCD;">心得体会与评论审核</Button>
				</div>
			</div>
		
		</div>
		<div>
			<ss :tj="tj" ref="sjglss" ></ss>
		</div>
	</div>
</template>

<script>
	import ss from "./ss";
	const _config = require('./../../../../../config/config')
	export default {
		name: "bookmanage",
		data() {
			return {
				tj: {
					pid:'',//上级分类
					classid:'',//书籍分类
					bookname:'',//书籍名称
					author:'',//作者
				},
				pclass:[],//上级分类
				nclass:[],//下级分类
			}
		},
		methods: {
			search(){
				this.$refs.sjglss.load();
			},  
			addbook(){
				this.$refs.add.openmodal();
			},
			getPidClass(){
	        	//上级分类查询
	        	 this.$http.post("/host/readbook/sjfl/getPidClass.html")
				.then(result => {
					this.pclass=result;
				});
	        },
	        getnextClass(){
	        	if(this.tj.pid){
	        		//上级分类查询
		        	 this.$http.post("/host/readbook/sjgl/getChildClass.html?pid="+this.tj.pid)
					.then(result => {
						this.nclass=result;
					});
	        	}else{
	        		this.nclass=[];
	        	}
	        },
	        openxdth(){
	        	//打开心得体会审核
	        	this.$router.push({
					path: '/sjgl/xdthsh'
				});
	        },
		},
		components: {
			ss
		},
		mounted(){
			this.getPidClass();	
		},
		watch:{
		},
		computed: {
			
		}
	}
</script>

<style>
</style>